print("i2c.setup (sw)")
local re, H, T = i2c.readSHT30(i2c.createSoft(17,16,0x44))
print("i2c done (sw)")
check_eq(re,true,"sht30 read failed with soft i2c!")

check_eq(i2c.setup(0, i2c.FAST),1,"initial i2c failed")
print("i2c.send")
i2c.send(0, 0x44, string.char(0x2C, 0x06))
print("i2c.send end")
print("i2c.recv")
local data = i2c.recv(0, 0x44, 6)
print("i2c.recv end", #data)
assert(#data ~= 0)
print("i2c.close")
i2c.close(0)
print("i2c done")


print("i2c.setup")
check_eq(i2c.setup(0, i2c.FAST),1,"initial i2c failed")
print("i2c.readSHT30")
local re, H, T = i2c.readSHT30(0)
check_eq(re,true,"i2c.readSHT30 i2c failed")
print("i2c.close")
i2c.close(0)
print("i2c done")
check_eq(re,true,"sht30 read failed!")


